<?php
require_once('../inc/connect.php');

$connect = mysql_connect(DB_HOST, DB_USER, DB_PASS)
    or die('Unable to connect to server!');

mysql_select_db(DB_NAME)
    or die('Unable to select database!');

$query = mysql_query("SELECT id, name FROM categories");

while($row = mysql_fetch_assoc($query)): ?>
      <li>
        <a href="?cat=<?php echo $row['id']; ?>"><?php echo $row['name']; ?></a>
      </li>
<?php endwhile; ?>
